

        <g:set var="entityName" value="${message(code: 'teacher.label', default: 'Teacher')}" />
            <div class="list">
                <table>
                    <thead>
                        <tr>
                                                
                            <g:sortableColumn property="realname" title="${message(code: 'teacher.realname.label', default: 'Realname')}" />
                        
                            <g:sortableColumn property="sex" title="${message(code: 'teacher.sex.label', default: 'Sex')}" />
                        
                            <g:sortableColumn property="area" title="${message(code: 'teacher.area.label', default: 'Area')}" />

                            <th>可带科目</th>

                            <th></th>
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${teacherInstanceList}" status="i" var="teacherInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${teacherInstance.id}">${fieldValue(bean: teacherInstance, field: "realname")}</g:link></td>
                        
                            <td>${fieldValue(bean: teacherInstance, field: "sex")}</td>
                                                
                            <td>${fieldValue(bean: teacherInstance, field: "area")}</td>

                            <td style="width:180px">${fieldValue(bean: teacherInstance, field: "courses")}</td>

                            <td>
                                    <g:link action="show" id="${teacherInstance.id}">详情</g:link>
                                    <g:ifAnyGranted role="ROLE_ADMIN">
                                        <g:link action="edit" id="${teacherInstance.id}">修改</g:link>
                                        <g:link action="goswitch" id="${teacherInstance.id}">${teacherInstance.enabled?"关闭":"开启"}
                                        </g:link>
                                     </g:ifAnyGranted>

                                     <g:if test="${teacherInstance.id.toString() == loggedInUserInfo(field:'id').toString()}">
                                        <g:link action="edit" id="${teacherInstance.id}">修改</g:link>
                                     </g:if>

                            </td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
            </div>